home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM B4 / PD-ROM B4.iso / Entertainment / Strategy / Bolo / Bolo Utilities / BMAPEdit / BMAPEdit 1.2 / BMAPEdit 1.2.rsrc / PREC_103 < prev    next >
Text File  |  1993-06-21  |  2KB  |  92 lines

  1. /BMAPEditdict 250 dict def
  2. BMAPEditdict begin
  3.  
  4. /drawBMAPterrain
  5. { % stack: T, L, W
  6.  /W exch def
  7.  /L exch def
  8.  /T exch def
  9.  /pts_per_sqr W map_W div def
  10.  gsave
  11.  .2 setlinewidth 1 setlinecap 1 setlinejoin
  12.  W W scale
  13.  L W div T W div translate
  14.  map_W map_W 4 [map_W 0 0 map_W 0 0] { terrain } image
  15.  grestore
  16.  gsave
  17.  L T translate
  18.  0 0 moveto W 0 rlineto 0 W rlineto -1 W mul 0 rlineto
  19.  closepath 0 setgray stroke
  20.  grestore
  21. } def
  22.  
  23. /draw_spc_sqr
  24. { % stack: x, y, bitmap
  25.  /pattern exch def
  26.  /y exch map_T sub def
  27.  /x exch map_L sub def
  28.  gsave
  29.  L T translate
  30.  pts_per_sqr pts_per_sqr scale
  31.  x y translate
  32.  9 9 1 [9 0 0 9 0 0] { pattern } image
  33.  grestore
  34. } def
  35.  
  36. /draw_PB_range
  37. { % stack: x, y
  38.  /y exch map_T sub def
  39.  /x exch map_L sub def
  40.  gsave
  41.  L T translate
  42.  x pts_per_sqr mul pts_per_sqr 2 div add
  43.  y pts_per_sqr mul pts_per_sqr 2 div add
  44.  translate
  45.  newpath 0 0 pts_per_sqr 7.5 mul 0 360 arc
  46.  .1 setlinewidth 1 setgray gsave stroke grestore
  47.  [ pts_per_sqr pts_per_sqr ] 0 setdash 0 setgray stroke
  48.  grestore
  49. } def
  50.  
  51. /PB    <0800 4900 3E00 3E00 FF80 3E00 3E00 4900 0800> def
  52. /base  <8080 6300 5D00 2200 2A00 2200 5D00 6300 8080> def
  53. /start <E780 E780 E780 0080 0080 E780 E780 E780 FF80> def
  54.  
  55. /show_legend_box
  56. { % stack: x, y, gray, title
  57.  /title exch def
  58.  /gray exch def
  59.  gsave
  60.  translate
  61.  0 0 moveto 0 15 rlineto 15 0 rlineto 0 -15 rlineto closepath
  62.  gray setgray gsave fill grestore
  63.  .5 setlinewidth 1 setlinecap 1 setlinejoin 0 setgray stroke
  64.  20 11 moveto 1 -1 scale title show
  65.  grestore
  66. } def
  67.  
  68. /show_spc_legend
  69. { % stack: x, y, title, bitmap
  70.  /pattern exch def
  71.  /title exch def
  72.  gsave
  73.  translate
  74.  gsave
  75.  15 15 scale
  76.  9 9 1 [9 0 0 9 0 0] { pattern } image
  77.  grestore
  78.  20 11 moveto 1 -1 scale title show
  79.  grestore
  80. } def
  81.  
  82. /show_title
  83. { % stack: x, y, title
  84.  /title exch def
  85.  gsave
  86.  translate
  87.  title stringwidth pop -2 div 0 moveto 1 -1 scale title show
  88.  grestore
  89. } def
  90.  
  91. end
  92.